package com.kuaimacode.kframework.mybatis.mapper.agent;


import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kuaimacode.kframework.mybatis.models.agent.SysAgentPermission;

/**
 * 权限mapper
 **/
public interface SysAgentPermissionMapper extends BaseMapper<SysAgentPermission> {
	/**
	 * 根据用户id查询权限url
	 *
	 * @param userId
	 * @return
	 */
	List<SysAgentPermission> findPermissionListByUserId(String userId);

	/**
	 * 根据用户主键，获取其权限下所有的menu，按照sort asc排序
	 * @param userId
	 * @return
	 */
	List<SysAgentPermission> findMenuListByUserId(String userId);

	/**
	 * 根据父节点asc/排序值asc 查询所有的权限
	 *
	 * @return
	 */
	List<SysAgentPermission> findAllByOrderByParentAscIdAscSortAsc();
}
